﻿@model IEnumerable<Chilis.Caja.Data.Models.Caja>

@{
    ViewBag.Title = "Agregar Caja";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<script language="javascript1.1"> 

function jsSubmit() {
   


   if (document.frmIngresar.txtDescaja.value==''){
			alert('Ingrese la descripción de la caja');
			document.frmIngresar.txtDescaja.focus();
			return false;
			}


    if (document.frmIngresar.cajero.value==''){
			alert('Seleccione Cajero');
			document.frmIngresar.cajero.focus();
			return false;
			}

    if (document.frmIngresar.turno.value==''){
			alert('Seleccione turno');
			document.frmIngresar.turno.focus();
			return false;
			}

	   document.frmIngresar.submit();
	}


    function jsCancelar() {

      window.location.href = "/Caja/ListCajas?buscar=TODO";
    }


</script> 

<h1>Agregar Caja</h1>

     @using (Html.BeginForm("IngresarCaja", "Caja", FormMethod.Post, new { name = "frmIngresar", id = "frmIngresar", @class = "well" }))
     {      
          <table>
          <tr>
                              <td>Descripción Caja</td>
                              <td> <input id="txtDescaja" name="txtDescaja" type="text" value="" /></td>      
          </tr>
         
         
         
         <tr>
<td><label for="cajero">Cajero:</label></td>
<td>@Html.DropDownList("cajero", (SelectList)ViewBag.Cajeros, "--Select cajero--")</td>
        </tr>

         <tr>
<td><label for="turno">Turno:</label></td>
<td>@Html.DropDownList("turno", (SelectList)ViewBag.Turnos, "--Select turno--")</td>
        </tr>
         
 
          </table>
         
         
       <br />   
         <br /> 
         
      <button type="button" class="button aceptar" onclick="jsSubmit()">
          Grabar
       </button>   
        
               <button type="button" class="button cancelar" onclick="jsCancelar()">
          Cancelar
       </button>    
                              
         
     }

